package com.hjm.project.agentInfo.profitSbOrder.utils;

import com.yxhd.encrypt.EncryptUtils;
import org.springframework.util.ObjectUtils;

public class PublicTypeUtils {

    public static String getTypeStr(Object objStr){
        String type = objStr == null ? "" : objStr.toString();
        String text = "";
        switch (type){
            case "0":
                text = "直推分润";
                break;
            case "1":
                text = "团队分润";
                break;
            case "40":
                text = "交易奖励";
                break;
            case "39":
                text = "隐形奖励";
                break;
            case "38":
                text = "购机奖励";
                break;
            case "37":
                text = "服务费";
                break;
            case "36":
                text = "通讯费";
                break;
            case "18":
                text = "增量奖励";
                break;
            case "5":
                text = "阶段奖励";
                break;
            case "4":
                text = "达标奖励";
                break;
            case "3":
                text = "激活奖励";
                break;
            default:
                text = "未知";
                break;
        }
        return text;
    }
    public static String getCycleType(Object objStr){
        String type = objStr == null ? "" : objStr.toString();
        String text = "";
        switch (type){
            case "0":
                text = "日返";
                break;
            case "1":
                text = "月返";
                break;
        }
        return text;
    }

    public static String getStatusType(Object objStr){
        String type = objStr == null ? "" : objStr.toString();
        String text = "";
        switch (type){
            case "0":
                text = "待处理";
                break;
            case "1":
                text = "出款成功";
                break;
            case "-1":
                text = "已上送";
                break;
            case "-2":
                text = "出款失败";
                break;
            case "-3":
                text = "冻结";
                break;
            case "-4":
                text = "出款打回";
                break;
        }
        return text;
    }
    public static String getStageType(Object objStr){
        String type = objStr == null ? "" : objStr.toString();
        String text = "";
        switch (type){
            case "1":
                text = "激活返现";
                break;
            case "2":
                text = "一段达标";
                break;
            case "3":
                text = "二段达标";
                break;
            case "4":
                text = "三段达标";
                break;
            case "5":
                text = "四段达标";
                break;
            case "6":
                text = "五段达标";
                break;
            case "7":
                text = "六段达标";
                break;
            case "8":
                text = "七段达标";
                break;
        }
        return text;
    }

    public static String getPosType(Object objStr){
        String type = objStr == null ? "" : objStr.toString();
        String text = "";
        switch (type){
            case "0":
                text = "传统";
                break;
            case "4":
                text = "电签";
                break;
        }
        return text;
    }
    public static String getSnReturnType(Object objStr){
        String type = objStr == null ? "" : objStr.toString();
        String text = "";
        switch (type){
            case "0":
                text = "交易达标";
                break;
            case "3":
                text = "盟主";
                break;
            case "4":
                text = "团长";
                break;
            case "5":
                text = "业务员";
                break;
        }
        return text;
    }
    public static String getMsgTypeToStr(Object objStr){
        String type = objStr == null ? "" : objStr.toString();
        String text = "";
        switch (type){
            case "消费":
                text = "H007";
                break;
            case "支付宝":
                text = "H201";
                break;
            case "微信":
                text = "H202";
                break;
            case "银联扫码":
                text = "H302";
                break;
            case "手机支付":
                text = "H303";
                break;
        }
        return text;
    }
    public static String getCardTypeToStr(Object objStr){
        String type = objStr == null ? "" : objStr.toString();
        String text = "";
        switch (type){
            case "贷记卡":
                text = "2";
                break;
            case "借记卡":
                text = "1";
                break;
        }
        return text;
    }



    public static String getCard(Object objStr){
        if (!ObjectUtils.isEmpty(objStr)) {
            try {
                String decrypt = EncryptUtils.getDecrypt(objStr.toString());
                return decrypt;
            } catch (Exception e) {
                e.printStackTrace();
                return "";
            }
        }
        return "";
    }

}
